//
//  LCNewVideoListsViewCell.m
//  JKFuYinProject
//
//  Created by admin on 2018/4/19.
//  Copyright © 2018年 LC. All rights reserved.
//

#import "LCNewVideoListsViewCell.h"

@implementation LCNewVideoListsViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        self.layer.masksToBounds = NO;
        //设置阴影的高度
        self.layer.shadowOffset = CGSizeMake(0, 1);
        //设置透明度
        self.layer.shadowOpacity = 0.2;
        self.layer.shadowPath = [UIBezierPath bezierPathWithRect:self.bounds].CGPath;
        // 设置圆角大小
        self.layer.cornerRadius = 6.0;
        
        
        UIButton *butMove = [[UIButton alloc] init];
        _butMove = butMove;
        butMove.frame = CGRectMake(0, 0, self.width-20-20, 30);
        [self addSubview:butMove];
        
        UILabel *labelTitle = [[UILabel alloc] initWithFrame:CGRectMake(15, 15,WidthScal750(200), 15)];
        _labelTitle = labelTitle;
        [LSZSpecialPackaging setLabelAdaptiveSize:labelTitle font:15];

        labelTitle.textColor = titleColorLSZ;
        [butMove addSubview:labelTitle];
        
        UIButton *imageViewClickMove = [[UIButton alloc] initWithFrame:CGRectMake(self.width-20-20-10,labelTitle.frame.origin.y+1, 20+20, 20)];
        _imageViewClickMove = imageViewClickMove;
//        imageViewClickMove.image = [UIImage imageNamed:@"向右箭头"];
        [imageViewClickMove setTitle:@"更多" forState:UIControlStateNormal];
        [imageViewClickMove setTitleColor:RGBColor(235, 82, 74) forState:UIControlStateNormal];
        [LSZSpecialPackaging setLabel_14_5_Size:imageViewClickMove.titleLabel];

        [self addSubview:imageViewClickMove];
        
        UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
        CGFloat width = (self.width - 40 -1) / 3;
        flowLayout.itemSize = CGSizeMake(width-15,self.height-20-CGRectGetMaxY(self.butMove.frame)-2-20-20/**width*1.44+10+44*/);
        flowLayout.scrollDirection = UICollectionViewScrollDirectionHorizontal;//水平滚动
        flowLayout.sectionInset = UIEdgeInsetsMake(15, 15, 15, 15);
        flowLayout.minimumLineSpacing = 20;//间距
        LCVideoSingleListsCollectionView *myCollectionView = [[LCVideoSingleListsCollectionView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(self.butMove.frame)+2 , self.width, self.height-20-CGRectGetMaxY(self.butMove.frame)-2) collectionViewLayout:flowLayout];
//    myCollectionView.backgroundColor = arc4random_color;//调用随机色
        _myCollectionView = myCollectionView;
        myCollectionView.scrollsToTop = NO;
        myCollectionView.showsVerticalScrollIndicator = NO;
        myCollectionView.showsHorizontalScrollIndicator = NO;
        [self.contentView addSubview:myCollectionView];

    }
    return self;
}

//- (void)setModel:(LCVideoHomeModel *)model{
//    _model = model;
//}

@end
